<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>margin居中对象</title>
		<style>
			#d1{
				height: 500px;
				width: 450px;
				background-color: lightcoral;
				/* margin: 50px auto; */
			}
			#d1 #nav{
				background-color: deeppink;
				width: 150px;
				text-align: center;
				/* margin: 10px auto; */
				margin: 10px 40px 20px 60px;
			}
		</style>
	</head>
	<body>
		<div id="d1">
			
			<div id="nav">
				你好，我是渣渣灰
			</div>
			<!-- <p style="background-color: blue;margin: -15px auto;">dddd</p> -->
		</div>
	</body>
</html>